﻿package src {
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.display.StageAlign;
	
	public class Main extends MovieClip{

		public function Main() {
			if (stage) init(null);
			else stage.addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(event:Event){
			stage.removeEventListener(Event.ADDED_TO_STAGE, init);
			stage.align = StageAlign.TOP_LEFT;
			
			preloader.setLoaderInfo(loaderInfo);
			preloader.addEventListener(Event.COMPLETE, onPreloaderComplete);
		}
		
		private function onPreloaderComplete(e:Event):void {  
             preloader.removeEventListener(Event.COMPLETE, onPreloaderComplete);
			 play();
       	}
	}
	
}
